<?php
include('config.php');
header("conent-type:text/html; charset=uft-8");
$where = 1;
$type_name = isset($_POST['type_name']) ? $_POST['type_name'] : '';

$rs = $mysql->selectList('type'," type_name='".$type_name."'");
if($type_name){
	$where = "type_id={$rs[0]['type_id']}";
}

$keyword = isset($_POST['keyword']) ? trim($_POST['keyword']) : '';
if($keyword){
	$where .= " and breed_name like '%{$keyword}%'";
}
$result = @$mysql->selectList('breed',$where);

if($result){
	foreach ($result as $k=>$v){
		echo '<label style="display:block;" ondblclick="dblNames('.$v['breed_id'].')" id="change_names'.$v['breed_id'].'" onclick="select_name_change_backgroud('.$v['breed_id'].')"><input type="radio"  name="radiobutton" value="'.$v['breed_name'].'"/>'.$v['breed_name'].'</label>';
	}
}
